package com.carter.springframework.beans.factory.support;

import com.carter.springframework.beans.exception.BeanException;
import com.carter.springframework.beans.factory.config.BeanDefinition;

import java.lang.reflect.Constructor;

/**
 * 实例化bean策略接口
 */
public interface InstantiationStrategy{
    /**
     * 实例化bean的方法
     * @param beanDefinition
     * @param beanName
     * @param constructor
     * @param args
     * @return
     * @throws BeanException
     */
    Object instantiate(BeanDefinition beanDefinition, String beanName, Constructor<?> constructor,Object[] args) throws BeanException;
}
